{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\f002mrh\Dropbox\Trade Attitudes\Data and Code\Replication Files for FPA\\UScodinglog.txt
  {txt}log type:  {res}smcl
 {txt}opened on:  {res}20 Nov 2020, 12:06:48
{txt}
{com}. 
. 
. **** Demographic characteristics, Partisanship, Ideology
. *Education
. tab educ, gen(educ_)

           {txt}education {c |}      Freq.     Percent        Cum.
{hline 21}{c +}{hline 35}
               No HS {c |}{res}        426        4.10        4.10
{txt}High school graduate {c |}{res}      3,273       31.48       35.57
{txt}        Some college {c |}{res}      2,475       23.80       59.38
{txt}              2-year {c |}{res}      1,066       10.25       69.63
{txt}              4-year {c |}{res}      1,967       18.92       88.55
{txt}           Post-grad {c |}{res}      1,191       11.45      100.00
{txt}{hline 21}{c +}{hline 35}
               Total {c |}{res}     10,398      100.00
{txt}
{com}. gen nocoll = educ_1 + educ_2
{txt}
{com}. gen somecoll = educ_3 
{txt}
{com}. gen twocoll = educ_4 
{txt}
{com}. gen coll = educ_5
{txt}
{com}. gen postgr = educ_6
{txt}
{com}. 
. gen university = 0
{txt}
{com}. replace university = 1 if coll==1
{txt}(1967 real changes made)

{com}. replace university = 1 if postgr==1
{txt}(1191 real changes made)

{com}. 
. *Race
. gen white = 0
{txt}
{com}. replace white = 1 if race==1
{txt}(7714 real changes made)

{com}. tab race, gen(race_)

           {txt}race {c |}      Freq.     Percent        Cum.
{hline 16}{c +}{hline 35}
          White {c |}{res}      7,714       74.19       74.19
{txt}          Black {c |}{res}      1,061       10.20       84.39
{txt}       Hispanic {c |}{res}        828        7.96       92.35
{txt}          Asian {c |}{res}        195        1.88       94.23
{txt}Native American {c |}{res}        112        1.08       95.31
{txt}          Mixed {c |}{res}        254        2.44       97.75
{txt}          Other {c |}{res}        211        2.03       99.78
{txt} Middle Eastern {c |}{res}         23        0.22      100.00
{txt}{hline 16}{c +}{hline 35}
          Total {c |}{res}     10,398      100.00
{txt}
{com}. 
. *Gender
. recode gender (1=1) (2=0), gen(male)
{txt}(5787 differences between gender and male)

{com}. 
. *Age
. gen age1 = 0
{txt}
{com}. replace age1 = 1 if age < 30
{txt}(1335 real changes made)

{com}. gen age2 = 0
{txt}
{com}. replace age2 = 1 if age < 45 & age > 29
{txt}(2754 real changes made)

{com}. gen age3 = 0
{txt}
{com}. replace age3 = 1 if age > 44 & age < 65
{txt}(3887 real changes made)

{com}. gen age4 = 0
{txt}
{com}. replace age4 = 1 if age > 64
{txt}(2422 real changes made)

{com}. 
. *Partisanship
. gen repub = .
{txt}(10398 missing values generated)

{com}. replace repub = 0 if w2USparty1==2 | w2USparty2==1
{txt}(755 real changes made)

{com}. replace repub = 0 if w2USparty4==2 | w2USparty4==3 | w2USparty4==4
{txt}(605 real changes made)

{com}. replace repub = 1 if w2USparty1==1 |w2USparty2==2
{txt}(695 real changes made)

{com}. replace repub = 1 if w2USparty4==1
{txt}(293 real changes made)

{com}. 
. gen ind = 0
{txt}
{com}. replace ind = 1 if w2USparty4==3 | w2USparty4==4
{txt}(398 real changes made)

{com}. 
. *Ideology
. *coded such that higher values are more conservative
. tab ideo5

         {txt}Ideology {c |}      Freq.     Percent        Cum.
{hline 18}{c +}{hline 35}
     Very liberal {c |}{res}      1,191       11.77       11.77
{txt}          Liberal {c |}{res}      1,517       15.00       26.77
{txt}         Moderate {c |}{res}      2,874       28.41       55.18
{txt}     Conservative {c |}{res}      2,148       21.23       76.41
{txt}Very conservative {c |}{res}      1,417       14.01       90.42
{txt}         Not sure {c |}{res}        969        9.58      100.00
{txt}{hline 18}{c +}{hline 35}
            Total {c |}{res}     10,116      100.00
{txt}
{com}. gen ideodk = ideo5
{txt}(282 missing values generated)

{com}. recode ideodk (6=3)
{txt}(ideodk: 969 changes made)

{com}. 
. *left/right partisan
. tab w2wing1a

 {txt}Left|Right {c |}      Freq.     Percent        Cum.
{hline 12}{c +}{hline 35}
          0 {c |}{res}        120        5.11        5.11
{txt}          1 {c |}{res}        107        4.56        9.67
{txt}          2 {c |}{res}        149        6.35       16.01
{txt}          3 {c |}{res}        144        6.13       22.15
{txt}          4 {c |}{res}        111        4.73       26.87
{txt}          5 {c |}{res}        645       27.47       54.34
{txt}          6 {c |}{res}        163        6.94       61.29
{txt}          7 {c |}{res}        189        8.05       69.34
{txt}          8 {c |}{res}        278       11.84       81.18
{txt}          9 {c |}{res}        201        8.56       89.74
{txt}         10 {c |}{res}        241       10.26      100.00
{txt}{hline 12}{c +}{hline 35}
      Total {c |}{res}      2,348      100.00
{txt}
{com}. 
. *Employment status
. tab employ, gen(employ_)

   {txt}employment status {c |}      Freq.     Percent        Cum.
{hline 21}{c +}{hline 35}
           Full-time {c |}{res}      3,909       37.59       37.59
{txt}           Part-time {c |}{res}      1,153       11.09       48.68
{txt}Temporarily laid off {c |}{res}         64        0.62       49.30
{txt}          Unemployed {c |}{res}        749        7.20       56.50
{txt}             Retired {c |}{res}      2,238       21.52       78.02
{txt}Permanently disabled {c |}{res}        754        7.25       85.28
{txt}           Homemaker {c |}{res}        793        7.63       92.90
{txt}             Student {c |}{res}        524        5.04       97.94
{txt}               Other {c |}{res}        214        2.06      100.00
{txt}{hline 21}{c +}{hline 35}
               Total {c |}{res}     10,398      100.00
{txt}
{com}. gen workfull = 0
{txt}
{com}. replace workfull = 1 if employ_1==1
{txt}(3909 real changes made)

{com}. gen workpart = 0
{txt}
{com}. replace workpart = 1 if employ_2==1
{txt}(1153 real changes made)

{com}. gen workunemp = 0 
{txt}
{com}. replace workunemp = 1 if employ_3==1 | employ_4==1 
{txt}(813 real changes made)

{com}. gen workstudent = 0 
{txt}
{com}. replace workstudent = 1 if employ_8==1
{txt}(524 real changes made)

{com}. gen workretired = 0
{txt}
{com}. replace workretired = 1 if employ_5==1
{txt}(2238 real changes made)

{com}. gen workother = 0
{txt}
{com}. replace workother = 1 if employ_9==1 | employ_7==1 | employ_6==1
{txt}(1761 real changes made)

{com}. label var workother "Homemaker/permanently disabled/Other"
{txt}
{com}. 
. *Income, different measure from other version of data
. tab faminc, gen(inc_)

      {txt}family income {c |}      Freq.     Percent        Cum.
{hline 20}{c +}{hline 35}
  Less than $10,000 {c |}{res}        585        6.38        6.38
{txt}  $10,000 - $19,999 {c |}{res}        734        8.00       14.38
{txt}  $20,000 - $29,999 {c |}{res}        915        9.97       24.35
{txt}  $30,000 - $39,999 {c |}{res}        963       10.50       34.85
{txt}  $40,000 - $49,999 {c |}{res}        772        8.42       43.26
{txt}  $50,000 - $59,999 {c |}{res}        736        8.02       51.29
{txt}  $60,000 - $69,999 {c |}{res}        561        6.12       57.40
{txt}  $70,000 - $79,999 {c |}{res}        540        5.89       63.29
{txt}  $80,000 - $99,999 {c |}{res}        650        7.09       70.37
{txt}$100,000 - $119,999 {c |}{res}        474        5.17       75.54
{txt}$120,000 - $149,999 {c |}{res}        380        4.14       79.68
{txt}$150,000 - $199,999 {c |}{res}        204        2.22       81.91
{txt}$200,000 - $249,999 {c |}{res}         96        1.05       82.95
{txt}$250,000 - $349,999 {c |}{res}         54        0.59       83.54
{txt}$350,000 - $499,999 {c |}{res}         15        0.16       83.70
{txt}   $500,000 or more {c |}{res}         21        0.23       83.93
{txt}   $150,000 or more {c |}{res}         51        0.56       84.49
{txt}  Prefer not to say {c |}{res}      1,423       15.51      100.00
{txt}{hline 20}{c +}{hline 35}
              Total {c |}{res}      9,174      100.00
{txt}
{com}. *crosstab ecluding prefer not to say
. tab faminc if faminc !=97 

      {txt}family income {c |}      Freq.     Percent        Cum.
{hline 20}{c +}{hline 35}
  Less than $10,000 {c |}{res}        585        7.55        7.55
{txt}  $10,000 - $19,999 {c |}{res}        734        9.47       17.02
{txt}  $20,000 - $29,999 {c |}{res}        915       11.80       28.82
{txt}  $30,000 - $39,999 {c |}{res}        963       12.42       41.25
{txt}  $40,000 - $49,999 {c |}{res}        772        9.96       51.21
{txt}  $50,000 - $59,999 {c |}{res}        736        9.50       60.70
{txt}  $60,000 - $69,999 {c |}{res}        561        7.24       67.94
{txt}  $70,000 - $79,999 {c |}{res}        540        6.97       74.91
{txt}  $80,000 - $99,999 {c |}{res}        650        8.39       83.29
{txt}$100,000 - $119,999 {c |}{res}        474        6.12       89.41
{txt}$120,000 - $149,999 {c |}{res}        380        4.90       94.31
{txt}$150,000 - $199,999 {c |}{res}        204        2.63       96.94
{txt}$200,000 - $249,999 {c |}{res}         96        1.24       98.18
{txt}$250,000 - $349,999 {c |}{res}         54        0.70       98.88
{txt}$350,000 - $499,999 {c |}{res}         15        0.19       99.07
{txt}   $500,000 or more {c |}{res}         21        0.27       99.34
{txt}   $150,000 or more {c |}{res}         51        0.66      100.00
{txt}{hline 20}{c +}{hline 35}
              Total {c |}{res}      7,751      100.00
{txt}
{com}. *quartiles
. gen inc30 = 0
{txt}
{com}. replace inc30 = 1 if inc_1==1 | inc_2==1 |inc_3==1
{txt}(2234 real changes made)

{com}. gen inc3050 = 0
{txt}
{com}. replace inc3050 = 1 if inc_4==1 | inc_5==1
{txt}(1735 real changes made)

{com}. gen inc5080 = 0
{txt}
{com}. replace inc5080 = 1 if inc_6==1 | inc_7==1 | inc_8==1
{txt}(1837 real changes made)

{com}. gen inc80up = 0
{txt}
{com}. replace inc80up = 1 if inc_9==1 | inc_10==1 | inc_11==1 | inc_12==1 |inc_17==1 | inc_13==1 | inc_14==1 | inc_15==1 | inc_16==1
{txt}(1945 real changes made)

{com}. 
. 
. *code don't know and prefer not to answer as missing
. foreach var of varlist inc30 inc3050 inc5080 inc80up {c -(}
{txt}  2{com}. replace `var' = . if inc_18==1 
{txt}  3{com}. {c )-}
{txt}(1423 real changes made, 1423 to missing)
(1423 real changes made, 1423 to missing)
(1423 real changes made, 1423 to missing)
(1423 real changes made, 1423 to missing)

{com}. 
. 
. ****Appendix Section 1.1: Nativism and Economic Perceptions Measurement 
. *Percent of sample dk on each item - range from 4.73 to 10.18% in the U.S. sample
. * DK = 7.11%
. tab w2eupan1 

 {txt}Even in its milder forms, {c |}
 Islam is a serious danger {c |}
  to Western civilization. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        558       23.76       23.76
{txt}                     Agree {c |}{res}        468       19.93       43.70
{txt}Neither agree nor disagree {c |}{res}        450       19.17       62.86
{txt}                  Disagree {c |}{res}        369       15.72       78.58
{txt}         Strongly disagree {c |}{res}        336       14.31       92.89
{txt}              Don’t know {c |}{res}        167        7.11      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. * DK = 4.73%
. tab w2eupan2

    {txt}The United States  has {c |}
       benefitted from the {c |}
 arrival in recent decades {c |}
               of people f {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        387       16.48       16.48
{txt}                     Agree {c |}{res}        869       37.01       53.49
{txt}Neither agree nor disagree {c |}{res}        550       23.42       76.92
{txt}                  Disagree {c |}{res}        249       10.60       87.52
{txt}         Strongly disagree {c |}{res}        182        7.75       95.27
{txt}              Don’t know {c |}{res}        111        4.73      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. *DK = 5.45%
. tab w2eupan3

{txt}All further immigration to {c |}
  the US should be halted. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        319       13.59       13.59
{txt}                     Agree {c |}{res}        306       13.03       26.62
{txt}Neither agree nor disagree {c |}{res}        489       20.83       47.44
{txt}                  Disagree {c |}{res}        651       27.73       75.17
{txt}         Strongly disagree {c |}{res}        455       19.38       94.55
{txt}              Don’t know {c |}{res}        128        5.45      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. * DK = 5.24%
. tab w2eupan4 

  {txt}The United States should {c |}
 allow more highly skilled {c |}
     immigrants from other {c |}
                   countri {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        281       11.97       11.97
{txt}                     Agree {c |}{res}        605       25.77       37.73
{txt}Neither agree nor disagree {c |}{res}        692       29.47       67.21
{txt}                  Disagree {c |}{res}        358       15.25       82.45
{txt}         Strongly disagree {c |}{res}        289       12.31       94.76
{txt}              Don’t know {c |}{res}        123        5.24      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. *DK = 6.05%
. tab w2eupan5

  {txt}The United States should {c |}
    allow more low-skilled {c |}
     immigrants from other {c |}
                countries  {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        100        4.26        4.26
{txt}                     Agree {c |}{res}        239       10.18       14.44
{txt}Neither agree nor disagree {c |}{res}        643       27.39       41.82
{txt}                  Disagree {c |}{res}        553       23.55       65.37
{txt}         Strongly disagree {c |}{res}        671       28.58       93.95
{txt}              Don’t know {c |}{res}        142        6.05      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. *DK = 8.08%
. tab w2eupan6

{txt}Most crimes in America are {c |}
  committed by immigrants. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}         97        4.13        4.13
{txt}                     Agree {c |}{res}        206        8.77       12.90
{txt}Neither agree nor disagree {c |}{res}        550       23.42       36.33
{txt}                  Disagree {c |}{res}        707       30.11       66.44
{txt}         Strongly disagree {c |}{res}        596       25.38       91.82
{txt}              Don’t know {c |}{res}        192        8.18      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. *DK = 10.18%
. tab w2eupan7

     {txt}Immigration in recent {c |}
          years has helped {c |}
  America’s economy grow {c |}
          faster than it w {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        145        6.18        6.18
{txt}                     Agree {c |}{res}        417       17.76       23.94
{txt}Neither agree nor disagree {c |}{res}        547       23.30       47.23
{txt}                  Disagree {c |}{res}        519       22.10       69.34
{txt}         Strongly disagree {c |}{res}        481       20.49       89.82
{txt}              Don’t know {c |}{res}        239       10.18      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. *DK = 5.49%
. tab w2eupan8

     {txt}The Government should {c |}
  encourage immigrants and {c |}
   their families to leave {c |}
                 the Unite {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        211        8.99        8.99
{txt}                     Agree {c |}{res}        249       10.60       19.59
{txt}Neither agree nor disagree {c |}{res}        645       27.47       47.06
{txt}                  Disagree {c |}{res}        643       27.39       74.45
{txt}         Strongly disagree {c |}{res}        471       20.06       94.51
{txt}              Don’t know {c |}{res}        129        5.49      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,348      100.00
{txt}
{com}. 
. *Recode DK to midpoint*
. recode w2eupan1 (6=3), gen(w2eupan1a)
{txt}(167 differences between w2eupan1 and w2eupan1a)

{com}. recode w2eupan2 (6=3), gen(w2eupan2a)
{txt}(111 differences between w2eupan2 and w2eupan2a)

{com}. recode w2eupan3 (6=3), gen(w2eupan3a)
{txt}(128 differences between w2eupan3 and w2eupan3a)

{com}. recode w2eupan4 (6=3), gen(w2eupan4a)
{txt}(123 differences between w2eupan4 and w2eupan4a)

{com}. recode w2eupan5 (6=3), gen(w2eupan5a)
{txt}(142 differences between w2eupan5 and w2eupan5a)

{com}. recode w2eupan6 (6=3), gen(w2eupan6a)
{txt}(192 differences between w2eupan6 and w2eupan6a)

{com}. recode w2eupan7 (6=3), gen(w2eupan7a)
{txt}(239 differences between w2eupan7 and w2eupan7a)

{com}. recode w2eupan8 (6=3), gen(w2eupan8a)
{txt}(129 differences between w2eupan8 and w2eupan8a)

{com}. 
. *alpha = 0.8521
. alpha w2eupan1a w2eupan2a w2eupan3a w2eupan4a w2eupan5a w2eupan6a w2eupan7a w2eupan8a, item

{txt}Test scale = mean(unstandardized items)

                                                            average
                             item-test     item-rest       interitem
Item         {c |}  Obs  Sign   correlation   correlation     covariance      alpha
{hline 13}{c +}{hline 65}
w2eupan1a{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.6775{col 45} 0.5421{col 59} .5837685{col 73} 0.8418
{txt}w2eupan2a{col 14}{c |}{res}{col 16}2348{col 24}-{col 31} 0.7348{col 45} 0.6411{col 59}  .585974{col 73} 0.8288
{txt}w2eupan3a{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.7871{col 45} 0.6935{col 59} .5447398{col 73} 0.8211
{txt}w2eupan4a{col 14}{c |}{res}{col 16}2348{col 24}-{col 31} 0.6463{col 45} 0.5248{col 59}  .612422{col 73} 0.8421
{txt}w2eupan5a{col 14}{c |}{res}{col 16}2348{col 24}-{col 31} 0.6874{col 45} 0.5810{col 59} .6021394{col 73} 0.8356
{txt}w2eupan6a{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.6497{col 45} 0.5401{col 59} .6203858{col 73} 0.8402
{txt}w2eupan7a{col 14}{c |}{res}{col 16}2348{col 24}-{col 31} 0.7082{col 45} 0.6027{col 59} .5901614{col 73} 0.8330
{txt}w2eupan8a{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.7220{col 45} 0.6187{col 59} .5833779{col 73} 0.8310
{txt}{hline 13}{c +}{hline 65}
Test scale{col 14}{c |}{res}{col 59} .5903711{col 73} 0.8520
{txt}{hline 13}{c BT}{hline 65}

{com}. 
. *Reverse code so Nativist response is high end of scale
. recode w2eupan1a w2eupan3a w2eupan6a w2eupan8a (1=5) (2=4) (3=3) (4=2) (5=1)
{txt}(w2eupan1a: 1731 changes made)
(w2eupan3a: 1731 changes made)
(w2eupan6a: 1606 changes made)
(w2eupan8a: 1574 changes made)

{com}. 
. *An additive scale
. gen natism = w2eupan1a + w2eupan2a + w2eupan3a + w2eupan4a + w2eupan5a + w2eupan6a + w2eupan7a + w2eupan8a 
{txt}(8050 missing values generated)

{com}. 
. *Alpha for 2-item version = 0.54
. alpha w2eupan1a w2eupan2a

{txt}Test scale = mean(unstandardized items)

Average interitem covariance:{col 34}{res} .5625047
{txt}Number of items in the scale:{col 34}{res}        2
{txt}Scale reliability coefficient:{col 34}{res}   0.5350
{txt}
{com}. 
. *Belief in free market, market regulation (measured in previous wave)
. tab w1fremkt1

{txt}People are better off in a {c |}
      free market economy. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        865       30.22       30.22
{txt}                     Agree {c |}{res}        698       24.39       54.61
{txt}Neither agree nor disagree {c |}{res}        744       26.00       80.61
{txt}                  Disagree {c |}{res}        179        6.25       86.86
{txt}         Strongly disagree {c |}{res}        134        4.68       91.54
{txt}                Dont know {c |}{res}        242        8.46      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,862      100.00
{txt}
{com}. tab w1regmkt1

     {txt}The government has an {c |}
 essential role to play in {c |}
    regulating the market. {c |}      Freq.     Percent        Cum.
{hline 27}{c +}{hline 35}
            Strongly agree {c |}{res}        418       14.61       14.61
{txt}                     Agree {c |}{res}        763       26.66       41.26
{txt}Neither agree nor disagree {c |}{res}        681       23.79       65.06
{txt}                  Disagree {c |}{res}        427       14.92       79.98
{txt}         Strongly disagree {c |}{res}        451       15.76       95.74
{txt}                Dont know {c |}{res}        122        4.26      100.00
{txt}{hline 27}{c +}{hline 35}
                     Total {c |}{res}      2,862      100.00
{txt}
{com}. 
. foreach var of varlist w1fremkt1 w1regmkt1 {c -(}
{txt}  2{com}. gen `var'r=`var'
{txt}  3{com}. recode `var'r (6=3) (1=5) (2=4) (3=3) (4=2) (5=1)
{txt}  4{com}. {c )-}
{txt}(7536 missing values generated)
(w1fremkt1r: 2118 changes made)
(7536 missing values generated)
(w1regmkt1r: 2181 changes made)

{com}. 
. 
. *Additional Control Variables: 
. *Economic Sentiment
. *Retrospective economic sentiment
. foreach var of varlist w2econ1 w2econ2 {c -(}
{txt}  2{com}. gen new`var'=`var'
{txt}  3{com}. recode new`var' (1=5) (2=4) (3=3) (4=2) (5=1) (6=3)
{txt}  4{com}. {c )-}
{txt}(8050 missing values generated)
(neww2econ1: 1752 changes made)
(8050 missing values generated)
(neww2econ2: 1445 changes made)

{com}. 
. 
. *Prospective economic sentiment 
. foreach var of varlist w2econp1 w2econp2 {c -(}
{txt}  2{com}. gen new`var'=`var'
{txt}  3{com}. recode new`var' (6=3)
{txt}  4{com}. **(1=5) (2=4) (3=3) (4=2) (5=1) 
. {c )-}
{txt}(8050 missing values generated)
(neww2econp1: 156 changes made)
(8050 missing values generated)
(neww2econp2: 190 changes made)

{com}. 
. *These form a single factor
. factor w2econ1 w2econ2 w2econp1 w2econp2, ml
{txt}(obs=2348)
number of factors adjusted to {res}1
{txt}Iteration 0:   log likelihood = {res}-281.64018
{txt}Iteration 1:   log likelihood = {res}-262.71412
{txt}Iteration 2:   log likelihood = {res} -261.0126
{txt}Iteration 3:   log likelihood = {res}-260.38631
{txt}Iteration 4:   log likelihood = {res}-260.17281
{txt}Iteration 5:   log likelihood = {res}-260.10389
{txt}Iteration 6:   log likelihood = {res}-260.08237
{txt}Iteration 7:   log likelihood = {res}-260.07579
{txt}Iteration 8:   log likelihood = {res}-260.07379
{txt}Iteration 9:   log likelihood = {res}-260.07319
{txt}Iteration 10:  log likelihood = {res}-260.07301
{txt}Iteration 11:  log likelihood = {res}-260.07296
{txt}Iteration 12:  log likelihood = {res}-260.07294

{txt}Factor analysis/correlation{col 52}Number of obs    = {res}    2348
{col 5}{txt}Method: maximum likelihood{col 52}Retained factors = {res}       1
{col 5}{txt}Rotation: (unrotated){col 52}Number of params = {res}       4
{col 52}{txt}Schwarz's BIC    = {res} 551.191
{col 5}{txt}Log likelihood = {res}-260.0729{col 52}{txt}(Akaike's) AIC   = {res} 528.146

{txt}{col 5}{hline 13}{c TT}{hline 60}
{col 5}     Factor  {c |} {ralign 12:Eigenvalue}   Difference        Proportion   Cumulative
{col 5}{hline 13}{c +}{hline 60}
{col 5}{ralign 11:Factor1}  {c |}{res}      1.99194            .            1.0000       1.0000
{txt}{col 5}{hline 13}{c BT}{hline 60}
{col 5}LR test: independent vs. saturated:  chi2({res}6{txt})  ={res} 3275.59{txt} Prob>chi2 ={res} 0.0000
{txt}{col 5}LR test: {res}   1{txt} factor vs. saturated:  chi2({res}2{txt})  ={res}  519.52{txt} Prob>chi2 ={res} 0.0000

{txt}Factor loadings (pattern matrix) and unique variances

{space 4}{hline 13}{c  TT}{hline 10}{c  TT}{hline 14}
{space 4}{space 0}{ralign 12:Variable}{space 1}{c |}{space 1}{ralign 8:Factor1}{space 1}{c |}{space 1}{ralign 12:Uniqueness}{space 1}
{space 4}{hline 13}{c   +}{hline 10}{c   +}{hline 14}
{space 4}{space 0}{ralign 12:w2econ1}{space 1}{c |}{space 1}{ralign 8:{res:{sf: -0.7034}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.5053}}}{space 1}
{space 4}{space 0}{ralign 12:w2econ2}{space 1}{c |}{space 1}{ralign 8:{res:{sf: -0.5773}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.6667}}}{space 1}
{space 4}{space 0}{ralign 12:w2econp1}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.7105}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.4952}}}{space 1}
{space 4}{space 0}{ralign 12:w2econp2}{space 1}{c |}{space 1}{ralign 8:{res:{sf:  0.8118}}}{space 1}{c |}{space 1}{center 12:{res:{sf:    0.3409}}}{space 1}
{space 4}{hline 13}{c  BT}{hline 10}{c  BT}{hline 14}

{com}. 
. *alpha = 0.85
. alpha neww2econ1 neww2econ2 neww2econp1 neww2econp2, item gen(econsentimentw2)

{txt}Test scale = mean(unstandardized items)

                                                            average
                             item-test     item-rest       interitem
Item         {c |}  Obs  Sign   correlation   correlation     covariance      alpha
{hline 13}{c +}{hline 65}
neww2econ1{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.8692{col 45} 0.7352{col 59}  .577409{col 73} 0.7811
{txt}neww2econ2{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.7725{col 45} 0.6044{col 59} .7376437{col 73} 0.8358
{txt}neww2econp1{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.8005{col 45} 0.6622{col 59} .7235191{col 73} 0.8142
{txt}neww2econp2{col 14}{c |}{res}{col 16}2348{col 24}+{col 31} 0.8637{col 45} 0.7386{col 59} .6045864{col 73} 0.7786
{txt}{hline 13}{c +}{hline 65}
Test scale{col 14}{c |}{res}{col 59} .6607895{col 73} 0.8455
{txt}{hline 13}{c BT}{hline 65}

{com}. *rescale 0 to 1
. replace econsentimentw2=econsentimentw2-1
{txt}(2348 real changes made)

{com}. replace econsentimentw2=econsentimentw2/4
{txt}(2243 real changes made)

{com}. 
. 
. *Universalism
. tab w2Univ2f1

{txt}She wants everyone {c |}
     to be treated {c |}
     justly. It is {c |}
  important to her {c |}
  to protect the w {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        455       35.66       35.66
{txt}           Like me {c |}{res}        312       24.45       60.11
{txt}  Somewhat like me {c |}{res}        226       17.71       77.82
{txt}  A little like me {c |}{res}        167       13.09       90.91
{txt}       Not like me {c |}{res}         55        4.31       95.22
{txt}Not like me at all {c |}{res}         19        1.49       96.71
{txt}      Don’t know {c |}{res}         42        3.29      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,276      100.00
{txt}
{com}. recode w2Univ2f1 (7=3.5), gen(Univ2f)
{txt}(42 differences between w2Univ2f1 and Univ2f)

{com}. tab w2Univ3f1

 {txt}She believes that {c |}
    all voices are {c |}
   important.  She {c |}
  wants all people {c |}
    to have the op {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        416       32.60       32.60
{txt}           Like me {c |}{res}        352       27.59       60.19
{txt}  Somewhat like me {c |}{res}        255       19.98       80.17
{txt}  A little like me {c |}{res}        158       12.38       92.55
{txt}       Not like me {c |}{res}         40        3.13       95.69
{txt}Not like me at all {c |}{res}         12        0.94       96.63
{txt}      Don’t know {c |}{res}         43        3.37      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,276      100.00
{txt}
{com}. recode w2Univ3f1 (7=3.5), gen(Univ3f)
{txt}(43 differences between w2Univ3f1 and Univ3f)

{com}. tab w2Univ2m1

 {txt}He wants everyone {c |}
     to be treated {c |}
     justly. It is {c |}
  important to him {c |}
 to protect the we {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        326       30.41       30.41
{txt}           Like me {c |}{res}        281       26.21       56.62
{txt}  Somewhat like me {c |}{res}        204       19.03       75.65
{txt}  A little like me {c |}{res}        155       14.46       90.11
{txt}       Not like me {c |}{res}         57        5.32       95.43
{txt}Not like me at all {c |}{res}         21        1.96       97.39
{txt}      Don’t know {c |}{res}         28        2.61      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,072      100.00
{txt}
{com}. recode w2Univ2m1 (7=3.5), gen(Univ2m)
{txt}(28 differences between w2Univ2m1 and Univ2m)

{com}. tab w2Univ3m1

  {txt}He believes that {c |}
    all voices are {c |}
    important.  He {c |}
  wants all people {c |}
  to have the oppo {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        259       24.16       24.16
{txt}           Like me {c |}{res}        330       30.78       54.94
{txt}  Somewhat like me {c |}{res}        235       21.92       76.87
{txt}  A little like me {c |}{res}        130       12.13       88.99
{txt}       Not like me {c |}{res}         77        7.18       96.18
{txt}Not like me at all {c |}{res}         12        1.12       97.29
{txt}      Don’t know {c |}{res}         29        2.71      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,072      100.00
{txt}
{com}. recode w2Univ3m1 (7=3.5), gen(Univ3m)
{txt}(29 differences between w2Univ3m1 and Univ3m)

{com}. *recode so high end of the scale = more commitment to universalism
. recode Univ2f Univ3f Univ2m Univ3m (1=6) (2=5) (3=4) (4=3) (5=2) (6=1)
{txt}(Univ2f: 1234 changes made)
(Univ3f: 1233 changes made)
(Univ2m: 1044 changes made)
(Univ3m: 1043 changes made)

{com}. 
. *combine male and female responses into single variable
. gen Univ2 = Univ2f 
{txt}(9122 missing values generated)

{com}. replace Univ2 = Univ2m if Univ2m !=.
{txt}(1072 real changes made)

{com}. gen Univ3 = Univ3f
{txt}(9122 missing values generated)

{com}. replace Univ3 = Univ3m if Univ3m !=.
{txt}(1072 real changes made)

{com}. 
. gen univ = Univ2 + Univ3
{txt}(8050 missing values generated)

{com}. *alpha = 0.7242
. alpha Univ2 Univ3

{txt}Test scale = mean(unstandardized items)

Average interitem covariance:{col 34}{res} .9069284
{txt}Number of items in the scale:{col 34}{res}        2
{txt}Scale reliability coefficient:{col 34}{res}   0.7242
{txt}
{com}. 
. *Repeat for conformity 
. tab w2Conform1f1

{txt}It is important to {c |}
     her to behave {c |}
     properly. She {c |}
   believes people {c |}
 should do what th {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        195       15.28       15.28
{txt}           Like me {c |}{res}        276       21.63       36.91
{txt}  Somewhat like me {c |}{res}        271       21.24       58.15
{txt}  A little like me {c |}{res}        250       19.59       77.74
{txt}       Not like me {c |}{res}        166       13.01       90.75
{txt}Not like me at all {c |}{res}         69        5.41       96.16
{txt}      Don’t know {c |}{res}         49        3.84      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,276      100.00
{txt}
{com}. recode w2Conform1f1 (7=3.5), gen(Conform1f)
{txt}(49 differences between w2Conform1f1 and Conform1f)

{com}. tab w2Conform1m1

{txt}It is important to {c |}
     him to behave {c |}
      properly. He {c |}
   believes people {c |}
should do what the {c |}      Freq.     Percent        Cum.
{hline 19}{c +}{hline 35}
 Very much like me {c |}{res}        147       13.71       13.71
{txt}           Like me {c |}{res}        259       24.16       37.87
{txt}  Somewhat like me {c |}{res}        222       20.71       58.58
{txt}  A little like me {c |}{res}        207       19.31       77.89
{txt}       Not like me {c |}{res}        134       12.50       90.39
{txt}Not like me at all {c |}{res}         70        6.53       96.92
{txt}      Don’t know {c |}{res}         33        3.08      100.00
{txt}{hline 19}{c +}{hline 35}
             Total {c |}{res}      1,072      100.00
{txt}
{com}. recode w2Conform1m1 (7=3.5), gen(Conform1m)
{txt}(33 differences between w2Conform1m1 and Conform1m)

{com}. recode Conform1f Conform1m (1=6) (2=5) (3=4) (4=3) (5=2) (6=1)
{txt}(Conform1f: 1227 changes made)
(Conform1m: 1039 changes made)

{com}. 
. *combine male and female responses into single variable
. gen conform = Conform1f
{txt}(9122 missing values generated)

{com}. replace conform = Conform1m if Conform1m !=.
{txt}(1072 real changes made)

{com}. 
. 
. 
. **********************************
. **** Coding for experimental data
. *********************************
. 
. *Dependent Variable*
. *Recode DK to midpoint*
. recode w2trade3a (6=3), gen(tradea)
{txt}(156 differences between w2trade3a and tradea)

{com}. recode w2trade3b (6=3), gen(tradeb)
{txt}(181 differences between w2trade3b and tradeb)

{com}. 
. *Generate a variable for experimental condition*
. gen tradeinfohi = .
{txt}(10398 missing values generated)

{com}. replace tradeinfohi = 1 if tradea != .
{txt}(1142 real changes made)

{com}. replace tradeinfohi = 0 if tradeb != .
{txt}(1206 real changes made)

{com}. 
. gen supptrade = .
{txt}(10398 missing values generated)

{com}. replace supptrade = tradea if tradea != .
{txt}(1142 real changes made)

{com}. replace supptrade = tradeb if tradeb != .
{txt}(1206 real changes made)

{com}. 
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}C:\Users\f002mrh\Dropbox\Trade Attitudes\Data and Code\Replication Files for FPA\\UScodinglog.txt
  {txt}log type:  {res}smcl
 {txt}closed on:  {res}20 Nov 2020, 12:06:52
{txt}{.-}
{smcl}
{txt}{sf}{ul off}